{include file='common/_meta' /}
<body>
<div class="container">

	<form class="layui-form" action="" lay-filter="" id="form-article">
		
		<div class="layui-row">
		  	<div class="layui-form-item layui-col-sm6">
		    	<label class="layui-form-label"><span class="custom-color-red">*</span>错误码：</label>
		    	<div class="layui-input-block">
			     	<input type="text" name="code" autocomplete="off" class="layui-input" lay-verify="required">
		    	</div>
		 	</div>
	 	</div>

	 	<div class="layui-row">
		  	<div class="layui-form-item layui-form-text layui-col-sm6">
		  	    <label class="layui-form-label"><span class="custom-color-red">*</span>描述：</label>
		  	    <div class="layui-input-block">
		  	      	<textarea name="desc" placeholder="建议短信内容标准长度100字以内" class="layui-textarea"></textarea>
		  	    </div>
		  	 </div>
	 	</div>
		
		<div class="layui-row">
		  	<div class="layui-form-item">
			    <div class="layui-input-block">
			     	<button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
			    </div>
		  	</div>
	  	</div>

	</form>

</div>
{include file="common/_footer"}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
layui.use('form', function() {

	var layer = layui.layer;
	var form  = layui.form;

	//监听提交
	form.on('submit(formDemo)', function(data) {

		$.ajax({
		    type : "POST",
		    url  : "{:url('ErrorComparison/add')}",
		    data : $("#form-article").serialize(),
		    success : function(e){
		        if(e != 'success'){
		            layer.msg(e,{icon: 5,time:3000});
		            return false;
		        }
		        layer.msg('新增成功',{icon:1,time:1000},function(){layer.open({type: 3});parent.location.reload();});
		    },
		    error : function(e){
		        layer.msg('新增错误',{icon: 5,time:3000});
		    }
		});

		return false;
	});
       
});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>